﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Http;
using AttributeRouting.Web.Http;

namespace HttpController
{
    /// <summary>
    /// 百度首页
    /// </summary>
    public class BaiduController : ApiController
    {
        /// <summary>
        /// 百度根据ID查询
        /// </summary>
        /// <param name="id">页数</param>
        /// <returns></returns>
        public IEnumerable<string> Get(int? id)
        {
            if (id.HasValue)
            {
                return new List<string> { "1", "ab", "dcd", "id value" };
            }
            else
            {
                return new List<string> { "no id", "no id", "no id", "no id value" };
            }
        }

        //[GET("baidu/test")]
        //public IEnumerable<string> GetByAttritute()
        //{
        //    return new List<string> { "1", "ab", "dcd", "id value", "baidu" };
        //}
    }
}
